//
//  GYSearchBar.m
//  GYDemo
//
//  Created by Mrzhang on 2018/4/12.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "GYSearchBar.h"
#import "Head.h"
@implementation GYSearchBar

- (void)layoutSubviews {
    [super layoutSubviews];

    for (UIView *view in self.subviews.lastObject.subviews) {
        if([view isKindOfClass:NSClassFromString(@"UISearchBarTextField")]) {
            UITextField *textField = (UITextField *)view;
            textField.clipsToBounds = YES;
            textField.layer.cornerRadius = 14;
            textField.backgroundColor=HEXCOLOR(@"#F7F7F7");
            textField.clearButtonMode=UITextFieldViewModeNever;
            textField.font=SYSTEMFONT(14);
            if (textField) {
                textField.frame = CGRectMake(0, 7, self.size.width, 30);
            }
        }
        if ([view isKindOfClass:NSClassFromString(@"UINavigationButton")]) {
            UIButton *cancel = (UIButton *)view;
            [cancel setTitle:@"取消" forState:UIControlStateNormal];
            cancel.titleLabel.font=SYSTEMFONT(15);
            [cancel setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
        }
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
